From: Caolán McNamara Date: Mon, 13 Jul 2026 22:42:37 +0000 (+0000) Subject: [PATCH] limit the gstreamer backend to simple self-contained media X-Git-Tag: archive/raspbian/4%25.2.3-2+rpi1+deb13u8^2~15 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=5c1fdb72f0c9b094c8da95be4cd866f0be515472;p=libreoffice.git [PATCH] limit the gstreamer backend to simple self-contained media The adaptive-streaming cases follow a more complicated indirect route of a manifest to further resources which is atypical for our use. Change-Id: I1a3e51d23cc4e8e2912304d5d1c3337c71c1029e Signed-off-by: Caolán McNamara Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/7008 Tested-by: Jenkins CPCI Reviewed-by: Miklos Vajna (cherry picked from commit c7eada5bc2233369e196f2c93e7606b56e3acc62) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208333 Tested-by: Jenkins Reviewed-by: Xisco Fauli Signed-off-by: Xisco Fauli Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208392 Reviewed-by: Hossein Tested-by: Ilmari Lauhakangas Reviewed-by: Ilmari Lauhakangas Gbp-Pq: Name CVE-2026-63269-1.diff --- diff --git a/avmedia/source/gstreamer/gstplayer.cxx b/avmedia/source/gstreamer/gstplayer.cxx index 1a91a689299..f435bd78826 100644 --- a/avmedia/source/gstreamer/gstplayer.cxx +++ b/avmedia/source/gstreamer/gstplayer.cxx @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -310,6 +311,38 @@ Player::Player() : mbInitialized = gst_init_check( &argc, &argv, &pError ); + if (mbInitialized) + { + // Drop the "Adaptive" ones to rank none as a crude but simple way to + // drop the cases that take a manifest to further resources that it + // names. Otherwise an option is to follow more closely what browsers + // probably do here and register a handler for fetching data. + GstRegistry* pRegistry = gst_registry_get(); + GList* pFactories = gst_registry_get_feature_list(pRegistry, GST_TYPE_ELEMENT_FACTORY); + for (GList* pItem = pFactories; pItem; pItem = pItem->next) + { + GstElementFactory* pFactory = GST_ELEMENT_FACTORY(pItem->data); + const gchar* pKlass = gst_element_factory_get_metadata(pFactory, GST_ELEMENT_METADATA_KLASS); + if (!pKlass) + continue; + + OString aKlass(pKlass); + bool bAdaptive = false; + for (sal_Int32 nIndex = 0; nIndex >= 0;) + { + if (o3tl::getToken(aKlass, 0, '/', nIndex) == "Adaptive") + { + bAdaptive = true; + break; + } + } + + if (bAdaptive) + gst_plugin_feature_set_rank(GST_PLUGIN_FEATURE(pFactory), GST_RANK_NONE); + } + gst_plugin_feature_list_free(pFactories); + } + SAL_INFO( "avmedia.gstreamer", AVVERSION << this << " Player::Player" ); if (pError != nullptr)